//
//  Projector.h
//  ___PROJECTNAME___
//
//  Created by Goffredo Marocchi on 8/26/10.
//  Copyright 2010 unofficial_sio2_template. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Math/Matrix.h"
#import "sio2.h"

@interface Projector : NSObject {
	
	SIO2camera *projector;
	MATRIX mProjection;
	MATRIX mView;
	MATRIX mTextureProjection;
	MATRIX mBackProjectionFix;
	MATRIX mBias;
	
	GLuint texture;
	GLuint backprojectionFixTexture;
	
	GLubyte *spriteData;
	GLubyte *spriteDataFix;
	
	CGImageRef spriteImage;
	size_t     width, height, widthFix, heightFix;
	
	BOOL updateTextureMap;
}

@property (assign) float aspectRatio;
@property (assign) BOOL updateTextureMap;

-(void) setProjector:(NSString*)sio2Projector;
-(void) calculateProjector;
-(void) submitProjectorGL;
-(void) uploadProjectorTex:(NSString*)file;
-(void) sendVPosAsTexcoords:(SIO2object*)obj;

-(void) rotateZ:(float)angleDeg;

@end
